package cool.mtc.minghe.data.model.sys.role.permission.form;

import cool.mtc.minghe.data.entity.sys.role.RolePermissionDO;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import javax.validation.constraints.NotNull;

/**
 * @author yz
 */
@Data
public class RolePermissionForm {

    @NotNull(message = "请选择角色")
    private Long roleId;

    @NotNull(message = "请选择权限")
    private Long permissionId;

    public RolePermissionDO transToDO() {
        RolePermissionDO rolePermissionDO = new RolePermissionDO();
        BeanUtils.copyProperties(this, rolePermissionDO);
        return rolePermissionDO;
    }
}
